package com.test2;

import java.util.Scanner;

public class Main1 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
        //while (in.hasNextInt()) {//注意while处理多个case
            String data = in.nextLine();
            int k = data.length() / 4;
            char[] c = data.toCharArray();
            String[] arr = new String[k+1];
            arr[0] = data.substring(0, k+1);
            arr[k] = new StringBuffer(data.substring(2*k,3*k+1)).reverse().toString(); 
            
            for(int i=1;i<k;i++){
            	 arr[i] = c[data.length()-i]+"";
            	 for(int j=1;j<k;j++){
            		 arr[i] += " ";
            	 }
            	 arr[i] += c[k+i]+"";
            }
            for(int i=0;i<=k;i++){
            	System.out.println(arr[i]);
            }
            
       // }
	}
}
